package org.ns.summer.example;

import org.apache.ibatis.annotations.*;

public interface UserInfoMapper {

    @Insert("insert into userInfo (userId, userName) values (#{userId}, #{userName})")
    Integer insert(@Param("userId") long userId, @Param("userName") String userName);

    @Select("select count(1) from userInfo where userId = #{userId}")
    Integer exist(@Param("userId") long userId);

    @Select("select userName from userInfo where userId = #{userId}")
    String getUserName(@Param("userId") long userId);

    @Delete("delete from userInfo where userId = #{userId}")
    Integer deleteByUserId(@Param("userId") long userId);
}
